<?php

 


require_once 'PHPUnit/Framework.php';
require_once 'PHPUnit/Util/Filter.php';

PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT');

if (!class_exists('PHPUnit_Framework_TestFailure', FALSE)) {


class PHPUnit_Framework_TestFailure
{
    
    protected $failedTest;

    
    protected $thrownException;

    
    public function __construct(PHPUnit_Framework_Test $failedTest, Exception $thrownException)
    {
        $this->failedTest      = $failedTest;
        $this->thrownException = $thrownException;
    }

    
    public function toString()
    {
        return sprintf(
          '%s: %s',

          $this->failedTest,
          $this->thrownException->getMessage()
        );
    }

    
    public function failedTest()
    {
        return $this->failedTest;
    }

    
    public function thrownException()
    {
        return $this->thrownException;
    }

    
    public function exceptionMessage()
    {
        return $this->thrownException()->getMessage();
    }

    
    public function isFailure()
    {
        return ($this->thrownException() instanceof PHPUnit_Framework_AssertionFailedError);
    }
}

}
?>
